package com.testing.utils;

import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.TestListenerAdapter;

/**
 * Created by Administrator on 2017/6/18.
 */
public class TestNGListener extends TestListenerAdapter{

    @Override
    public void onTestSuccess(ITestResult tr) {
        super.onTestSuccess(tr);
        LoggerConfig.LOGGER.info("【" + tr.getName() + " Success】");
    }

    @Override
    public void onTestFailure(ITestResult tr) {
        LoggerConfig.LOGGER.info("【" + tr.getName() + " Failure】");
        super.onTestFailure(tr);
    }

    @Override
    public void onTestSkipped(ITestResult tr) {
        LoggerConfig.LOGGER.info("【" + tr.getName() + " Skipped】");
        super.onTestSkipped(tr);
    }

    @Override
    public void onStart(ITestContext testContext) {
        LoggerConfig.LOGGER.info("【" + testContext.getName() + " Start】");
        super.onStart(testContext);
    }

    @Override
    public void onFinish(ITestContext testContext) {
        LoggerConfig.LOGGER.info("**************   Test Finish   ****************");
        super.onFinish(testContext);
    }
}
